#pragma once
//1.定义枚举类
//2.实现字符串接口:将枚举转换对应字符串



namespace nhylog
{
    class LogLevel
    {
    public:
        //C++98 的 enum 是 "非域内枚举"(unscoped enums)
        //C++11 加上class限定类域
        enum class value
        {
            UNKNOW = 0,
            DEBUG,
            INFO,
            WARN,
            ERROR,
            FATAL,
            OFF
        };

        static const char* toString(LogLevel::value level)
        {
            switch(level)
            {
                
                case LogLevel::value::DEBUG : return "DEBUG";
                case LogLevel::value::INFO : return "INFO";
                case LogLevel::value::WARN : return "WARN";
                case LogLevel::value::ERROR : return "DEBUG";
                case LogLevel::value::FATAL : return "FATAL";
                case LogLevel::value::OFF : return "OFF";
                
            }

            return "UNKNOW";
        }
    };


}

